package com.springbootbase.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author 你咋那么帅
 * @Date 2020/1/10
 */
//引入文件（局部的，就是自己创建的文件，全局的不用引入，应该是默认就引入了）
//@PropertySource("classpath:person.properties")
//@Component
//prefix的值表示映射到那个文件，就是使用配置文件储存信息的文件（这里就是application.yml）
//@ConfigurationProperties默认获取的是全局的配置文件中的内容
//就是那个自动生成的文件application.properties
@ConfigurationProperties(prefix = "person")
//@Validated//校验数据（使用该注解可以检验数据）
public class Person {

    //@Email//表示检验lastName是否为邮箱格式的值
    private String lastName;
    private Integer age;
    private Boolean boss;
    private Date date;
    private Map<String,Object> maps;
    private List<Object> lists;

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Boolean getBoss() {
        return boss;
    }

    public void setBoss(Boolean boss) {
        this.boss = boss;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Map<String, Object> getMaps() {
        return maps;
    }

    public void setMaps(Map<String, Object> maps) {
        this.maps = maps;
    }

    public List<Object> getLists() {
        return lists;
    }

    public void setLists(List<Object> lists) {
        this.lists = lists;
    }

    @Override
    public String toString() {
        return "Person{" +
                "lastName='" + lastName + '\'' +
                ", age=" + age +
                ", boss=" + boss +
                ", date=" + date +
                ", maps=" + maps +
                ", lists=" + lists +
                '}';
    }
}
